﻿package mortal.game.view.playerSystem
{
    import com.mui.controls.*;
    import mortal.component.window.*;
    import mortal.game.mvc.*;

    public class PlayerBaseController extends Object
    {
        protected var _view:GSprite;

        public function PlayerBaseController()
        {
            this.initServer();
            return;
        }// end function

        public function get view() : GSprite
        {
            if (this._view == null)
            {
                this._view = this.initView();
                this._view.isHideDispose = true;
            }
            return this._view;
        }// end function

        public function get window() : Window
        {
            return GameController.playerSystem.view as Window;
        }// end function

        public function get isViewShow() : Boolean
        {
            return this._view && this._view.parent;
        }// end function

        public function removeWin() : void
        {
            if (this._view && this._view.parent)
            {
                this._view.parent.removeChild(this._view);
            }
            return;
        }// end function

        protected function initView() : GSprite
        {
            return this._view;
        }// end function

        protected function initServer() : void
        {
            return;
        }// end function

        public function addWinShowEvent() : void
        {
            return;
        }// end function

        public function removeWinShowEvent() : void
        {
            return;
        }// end function

    }
}
